package com.nari.ysphd.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;


import com.jeremyfeinstein.AbsAdapter;
import com.jeremyfeinstein.AbsViewHolder;
import com.jeremyfeinstein.gson.Tenant;
import com.jeremyfeinstein.gson.TenantInfo;
import com.nari.ysphd.R;


/**
 * Created by sunxunchao on 2018/9/15.
 */
public class SelectUserAdapter extends AbsAdapter<TenantInfo, SelectUserAdapter.SelectUserViewHolder> {


    public SelectUserAdapter(Context context, int layoutId) {
        super(context, layoutId);
    }


    @Override
    protected void initData(TenantInfo data, SelectUserViewHolder holder, int position) {
        if (data == null) {
            holder.tenant_user.setText("所有人");
        } else {
            holder.tenant_user.setText(data.tenantName);
        }
    }

    @Override
    protected SelectUserViewHolder newViewHolder(int position) {
        return new SelectUserViewHolder();
    }

    static class SelectUserViewHolder extends AbsViewHolder {

        TextView tenant_user;

        @Override
        public void initItemView(View containerView) {
            tenant_user = (TextView) containerView.findViewById(R.id.tenant_user);
        }
    }
}
